package 结构性模式

/**
 * 为子系统中的一组接口提供一个一致的界面。Facade模式定义了一个高层接口，这个接口使得这一子系统更加容易使用
 */

class Company {
}

class AdminOfIndustry {
    fun register(name: String): Company {
        return Company()
    }
}

class Bank {
    fun openAccount(companyID: String) {
    }
}

class Taxation {
    fun applyTaxCode(companyID: String) {
    }
}

class Facade {
    private val admin = AdminOfIndustry()
    private val bank = Bank()
    private val tax = Taxation()

    fun openCompany(name: String): Company {
        val c: Company = this.admin.register(name)
        val bankAccount = this.bank.openAccount(name)
        val taxCode = this.tax.applyTaxCode(name)
        return c
    }
}